using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
using UserManagementService.Users;
using UserManagementService.DTOs;
using UserManagementService.Enums;

namespace UserManagementService.Users;

/// <summary>
/// 扩展用户应用服务接口
/// </summary>
public interface IExtendedUserAppService : ICrudAppService<
    IdentityUserDto,
    Guid,
    PagedAndSortedResultRequestDto,
    CreateUserDto,
    UpdateUserDto>
{
    /// <summary>
    /// 根据用户名获取用户
    /// </summary>
    Task<IdentityUserDto> GetByUserNameAsync(string userName);

    /// <summary>
    /// 根据邮箱获取用户
    /// </summary>
    Task<IdentityUserDto> GetByEmailAsync(string email);

    /// <summary>
    /// 根据手机号获取用户
    /// </summary>
    Task<IdentityUserDto> GetByPhoneNumberAsync(string phoneNumber);

    /// <summary>
    /// 获取用户统计信息
    /// </summary>
    Task<UserStatisticsDto> GetUserStatisticsAsync();

    /// <summary>
    /// 批量更新用户状态
    /// </summary>
    Task BatchUpdateUserStatusAsync(BatchUpdateUserStatusDto input);

    /// <summary>
    /// 搜索用户
    /// </summary>
    Task<PagedResultDto<IdentityUserDto>> SearchUsersAsync(SearchUsersDto input);

    /// <summary>
    /// 获取用户权限
    /// </summary>
    Task<List<string>> GetUserPermissionsAsync(Guid userId);

    /// <summary>
    /// 获取用户角色
    /// </summary>
    Task<List<string>> GetUserRolesAsync(Guid userId);

    /// <summary>
    /// 获取用户组织
    /// </summary>
    Task<List<OrganizationDto>> GetUserOrganizationsAsync(Guid userId);

    /// <summary>
    /// 解锁用户
    /// </summary>
    Task UnlockUserAsync(Guid userId);

    /// <summary>
    /// 强制用户在下次登录时修改密码
    /// </summary>
    Task ForcePasswordChangeAsync(Guid userId, bool forceChange);

    /// <summary>
    /// 重置用户密码
    /// </summary>
    Task<string> ResetPasswordAsync(Guid userId);

    /// <summary>
    /// 发送密码重置邮件
    /// </summary>
    Task SendPasswordResetEmailAsync(string email);

    /// <summary>
    /// 发送邮箱验证邮件
    /// </summary>
    Task SendEmailVerificationEmailAsync(Guid userId);

    /// <summary>
    /// 验证邮箱
    /// </summary>
    Task VerifyEmailAsync(Guid userId, string token);

    /// <summary>
    /// 获取用户登录历史
    /// </summary>
    Task<PagedResultDto<UserLoginHistoryDto>> GetUserLoginHistoryAsync(GetUserLoginHistoryDto input);

    /// <summary>
    /// 导出用户数据
    /// </summary>
    Task<FileDownloadResultDto> ExportUsersAsync(ExportUsersDto input);

    /// <summary>
    /// 导入用户数据
    /// </summary>
    Task<UserImportResultDto> ImportUsersAsync(ImportUsersDto input);

    /// <summary>
    /// 获取用户活动日志
    /// </summary>
    Task<PagedResultDto<UserActivityLogDto>> GetUserActivityLogsAsync(GetUserActivityLogsDto input);
}